package com.chi.service;

import com.chi.mapper.PwdMapper;
import com.chi.pojo.Pwd;

import java.util.List;

public class PwdServiceImpl implements PwdService{

    private PwdMapper pwdMapper;

    public void setPwdMapper(PwdMapper pwdMapper){
        this.pwdMapper = pwdMapper;
    }

    @Override
    public int addPwd(Pwd pwd) {
        return pwdMapper.addPwd(pwd);
    }

    @Override
    public int deletePwdById(int id) {
        return pwdMapper.deletePwdById(id);
    }

    @Override
    public int updatePwd(Pwd pwd) {
        return pwdMapper.updatePwd(pwd);
    }

    @Override
    public List<Pwd> queryPwdList(int startIndex,int pageSize) {
        return pwdMapper.queryPwdList(startIndex,pageSize);
    }

    @Override
    public Pwd queryPwdById(int id) {
        Pwd pwd = pwdMapper.queryPwdById(id);
        return pwd;
    }

    @Override
    public List<Pwd> selectPwd(String accountName) {
        accountName = "%" + accountName + "%";
        return pwdMapper.selectPwd(accountName);
    }

    @Override
    public int getPwdNum() {
        return pwdMapper.getPwdNum();
    }
}
